import 'package:enterprise_v6_app/app/components/custom_app_bar.dart';
import 'package:enterprise_v6_app/app/core/core.dart';
import 'package:enterprise_v6_app/app/modules/application/special_operation/special_list/management_operation_page/job_stop_and_off_page/job_stop_and_off_controller.dart';

/// 作业中断和终止
class JobStopAndOffPage extends StatelessWidget {
  JobStopAndOffPage({super.key});

  final controller = Get.put(JobStopAndOffController());

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: AppColors.bg_color_grey,
      appBar: CustomAppBar(
        titleText: controller.title,
      ),
      body: Container(
        color: Colors.white,
        alignment: Alignment.topLeft,
        padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.w),
        margin: EdgeInsets.only(top: 20.w),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Text(
              controller.title,
              style: TextStyle(
                fontSize: 16.sp,
                fontWeight: FontWeight.w500,
                color: const Color(0xff262F38),
              ),
            ),
            AppGaps.vGap16,
            Container(
                height: 135.w,
                decoration: BoxDecoration(
                  color: const Color(0xffF7F7FB),
                  borderRadius: BorderRadius.all(Radius.circular(4.w)),
                  border: Border.all(width: 1.w, color: const Color(0xffEBEDF0)),
                ),
                child: TextField(
                    keyboardType: TextInputType.text,
                    textInputAction: TextInputAction.done,
                    maxLines: null,
                    controller: controller.textEditingController,
                    style: TextStyle(
                        color: const Color(0xFF262F38), fontWeight: FontWeight.w400, fontSize: 14.w),
                    decoration: InputDecoration(
                      counterText: '',
                      //防止适配不居中
                      isCollapsed: true,
                      border: const OutlineInputBorder(borderSide: BorderSide.none),
                      contentPadding: EdgeInsets.symmetric(vertical: 5.w, horizontal: 9.w),
                      hintText: '请输入${controller.argument}...',
                      hintStyle: TextStyle(
                          fontSize: 14.w, fontWeight: FontWeight.w400, color: const Color(0xffA0A7B5)),
                    ))),
          ],
        ),
      ),
      bottomSheet: Container(
        height: 50.w,
        width: double.infinity,
        color: Colors.white,
        padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 5.w),
        child: ElevatedButton(
          style: ElevatedButton.styleFrom(
            backgroundColor: AppColors.blue_button,
            shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(22.r),
            ),
          ),
          onPressed: controller.complete,
          child: Text(
            '完成',
            style: TextStyle(
              fontSize: 16.sp,
              color: Colors.white,
            ),
          ),
        ),
      ),
    );
  }
}
